<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkTextMark: GTK+ 3 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GTK+ 3 Reference Manual">
<link rel="up" href="TextWidgetObjects.html" title="Multiline Text Editor">
<link rel="prev" href="GtkTextIter.html" title="GtkTextIter">
<link rel="next" href="GtkTextBuffer.html" title="GtkTextBuffer">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#GtkTextMark.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#GtkTextMark.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_properties">  <span class="dim">|</span> 
                  <a href="#GtkTextMark.properties" class="shortcut">Properties</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="TextWidgetObjects.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GtkTextIter.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GtkTextBuffer.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GtkTextMark"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GtkTextMark.top_of_page"></a>GtkTextMark</span></h2>
<p>GtkTextMark — A position in the buffer preserved across buffer modifications</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GtkTextMark.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="GtkTextMark.html" title="GtkTextMark"><span class="returnvalue">GtkTextMark</span></a> *
</td>
<td class="function_name">
<a class="link" href="GtkTextMark.html#gtk-text-mark-new" title="gtk_text_mark_new ()">gtk_text_mark_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkTextMark.html#gtk-text-mark-set-visible" title="gtk_text_mark_set_visible ()">gtk_text_mark_set_visible</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="GtkTextMark.html#gtk-text-mark-get-visible" title="gtk_text_mark_get_visible ()">gtk_text_mark_get_visible</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="GtkTextMark.html#gtk-text-mark-get-deleted" title="gtk_text_mark_get_deleted ()">gtk_text_mark_get_deleted</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="GtkTextMark.html#gtk-text-mark-get-name" title="gtk_text_mark_get_name ()">gtk_text_mark_get_name</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GtkTextBuffer.html" title="GtkTextBuffer"><span class="returnvalue">GtkTextBuffer</span></a> *
</td>
<td class="function_name">
<a class="link" href="GtkTextMark.html#gtk-text-mark-get-buffer" title="gtk_text_mark_get_buffer ()">gtk_text_mark_get_buffer</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="GtkTextMark.html#gtk-text-mark-get-left-gravity" title="gtk_text_mark_get_left_gravity ()">gtk_text_mark_get_left_gravity</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkTextMark.properties"></a><h2>Properties</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="properties_type">
<col width="300px" class="properties_name">
<col width="200px" class="properties_flags">
</colgroup>
<tbody>
<tr>
<td class="property_type"><span class="type">gboolean</span></td>
<td class="property_name"><a class="link" href="GtkTextMark.html#GtkTextMark--left-gravity" title="The “left-gravity” property">left-gravity</a></td>
<td class="property_flags">Read / Write / Construct Only</td>
</tr>
<tr>
<td class="property_type">
<span class="type">char</span> *</td>
<td class="property_name"><a class="link" href="GtkTextMark.html#GtkTextMark--name" title="The “name” property">name</a></td>
<td class="property_flags">Read / Write / Construct Only</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkTextMark.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody><tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="GtkTextMark.html#GtkTextMark-struct" title="struct GtkTextMark">GtkTextMark</a></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkTextMark.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    GObject
    <span class="lineart">╰──</span> GtkTextMark
</pre>
</div>
<div class="refsect1">
<a name="GtkTextMark.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gtk/gtk.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="GtkTextMark.description"></a><h2>Description</h2>
<p>You may wish to begin by reading the
<a class="link" href="TextWidget.html" title="Text Widget Overview">text widget conceptual overview</a>
which gives an overview of all the objects and data
types related to the text widget and how they work together.</p>
<p>A <a class="link" href="GtkTextMark.html" title="GtkTextMark"><span class="type">GtkTextMark</span></a> is like a bookmark in a text buffer; it preserves a position in
the text. You can convert the mark to an iterator using
<a class="link" href="GtkTextBuffer.html#gtk-text-buffer-get-iter-at-mark" title="gtk_text_buffer_get_iter_at_mark ()"><code class="function">gtk_text_buffer_get_iter_at_mark()</code></a>. Unlike iterators, marks remain valid across
buffer mutations, because their behavior is defined when text is inserted or
deleted. When text containing a mark is deleted, the mark remains in the
position originally occupied by the deleted text. When text is inserted at a
mark, a mark with “left gravity” will be moved to the
beginning of the newly-inserted text, and a mark with “right
gravity” will be moved to the end.</p>
<p>Note that “left” and “right” here refer to logical direction (left
is the toward the start of the buffer); in some languages such as
Hebrew the logically-leftmost text is not actually on the left when
displayed.</p>
<p>Marks are reference counted, but the reference count only controls the validity
of the memory; marks can be deleted from the buffer at any time with
<a class="link" href="GtkTextBuffer.html#gtk-text-buffer-delete-mark" title="gtk_text_buffer_delete_mark ()"><code class="function">gtk_text_buffer_delete_mark()</code></a>. Once deleted from the buffer, a mark is
essentially useless.</p>
<p>Marks optionally have names; these can be convenient to avoid passing the
<a class="link" href="GtkTextMark.html" title="GtkTextMark"><span class="type">GtkTextMark</span></a> object around.</p>
<p>Marks are typically created using the <a class="link" href="GtkTextBuffer.html#gtk-text-buffer-create-mark" title="gtk_text_buffer_create_mark ()"><code class="function">gtk_text_buffer_create_mark()</code></a> function.</p>
</div>
<div class="refsect1">
<a name="GtkTextMark.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gtk-text-mark-new"></a><h3>gtk_text_mark_new ()</h3>
<pre class="programlisting"><a class="link" href="GtkTextMark.html" title="GtkTextMark"><span class="returnvalue">GtkTextMark</span></a> *
gtk_text_mark_new (<em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>,
                   <em class="parameter"><code><span class="type">gboolean</span> left_gravity</code></em>);</pre>
<p>Creates a text mark. Add it to a buffer using <a class="link" href="GtkTextBuffer.html#gtk-text-buffer-add-mark" title="gtk_text_buffer_add_mark ()"><code class="function">gtk_text_buffer_add_mark()</code></a>.
If <em class="parameter"><code>name</code></em>
 is <code class="literal">NULL</code>, the mark is anonymous; otherwise, the mark can be 
retrieved by name using <a class="link" href="GtkTextBuffer.html#gtk-text-buffer-get-mark" title="gtk_text_buffer_get_mark ()"><code class="function">gtk_text_buffer_get_mark()</code></a>. If a mark has left 
gravity, and text is inserted at the mark’s current location, the mark 
will be moved to the left of the newly-inserted text. If the mark has 
right gravity (<em class="parameter"><code>left_gravity</code></em>
 = <code class="literal">FALSE</code>), the mark will end up on the 
right of newly-inserted text. The standard left-to-right cursor is a 
mark with right gravity (when you type, the cursor stays on the right
side of the text you’re typing).</p>
<div class="refsect3">
<a name="gtk-text-mark-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>name</p></td>
<td class="parameter_description"><p>mark name or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>left_gravity</p></td>
<td class="parameter_description"><p>whether the mark should have left gravity</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-text-mark-new.returns"></a><h4>Returns</h4>
<p> new <a class="link" href="GtkTextMark.html" title="GtkTextMark"><span class="type">GtkTextMark</span></a></p>
</div>
<p class="since">Since: 2.12</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-text-mark-set-visible"></a><h3>gtk_text_mark_set_visible ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_text_mark_set_visible (<em class="parameter"><code><a class="link" href="GtkTextMark.html" title="GtkTextMark"><span class="type">GtkTextMark</span></a> *mark</code></em>,
                           <em class="parameter"><code><span class="type">gboolean</span> setting</code></em>);</pre>
<p>Sets the visibility of <em class="parameter"><code>mark</code></em>
; the insertion point is normally
visible, i.e. you can see it as a vertical bar. Also, the text
widget uses a visible mark to indicate where a drop will occur when
dragging-and-dropping text. Most other marks are not visible.
Marks are not visible by default.</p>
<div class="refsect3">
<a name="gtk-text-mark-set-visible.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mark</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkTextMark.html" title="GtkTextMark"><span class="type">GtkTextMark</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>setting</p></td>
<td class="parameter_description"><p>visibility of mark</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-text-mark-get-visible"></a><h3>gtk_text_mark_get_visible ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gtk_text_mark_get_visible (<em class="parameter"><code><a class="link" href="GtkTextMark.html" title="GtkTextMark"><span class="type">GtkTextMark</span></a> *mark</code></em>);</pre>
<p>Returns <code class="literal">TRUE</code> if the mark is visible (i.e. a cursor is displayed
for it).</p>
<div class="refsect3">
<a name="gtk-text-mark-get-visible.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>mark</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkTextMark.html" title="GtkTextMark"><span class="type">GtkTextMark</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-text-mark-get-visible.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if visible</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-text-mark-get-deleted"></a><h3>gtk_text_mark_get_deleted ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gtk_text_mark_get_deleted (<em class="parameter"><code><a class="link" href="GtkTextMark.html" title="GtkTextMark"><span class="type">GtkTextMark</span></a> *mark</code></em>);</pre>
<p>Returns <code class="literal">TRUE</code> if the mark has been removed from its buffer
with <a class="link" href="GtkTextBuffer.html#gtk-text-buffer-delete-mark" title="gtk_text_buffer_delete_mark ()"><code class="function">gtk_text_buffer_delete_mark()</code></a>. See <a class="link" href="GtkTextBuffer.html#gtk-text-buffer-add-mark" title="gtk_text_buffer_add_mark ()"><code class="function">gtk_text_buffer_add_mark()</code></a>
for a way to add it to a buffer again.</p>
<div class="refsect3">
<a name="gtk-text-mark-get-deleted.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>mark</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkTextMark.html" title="GtkTextMark"><span class="type">GtkTextMark</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-text-mark-get-deleted.returns"></a><h4>Returns</h4>
<p> whether the mark is deleted</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-text-mark-get-name"></a><h3>gtk_text_mark_get_name ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> *
gtk_text_mark_get_name (<em class="parameter"><code><a class="link" href="GtkTextMark.html" title="GtkTextMark"><span class="type">GtkTextMark</span></a> *mark</code></em>);</pre>
<p>Returns the mark name; returns NULL for anonymous marks.</p>
<div class="refsect3">
<a name="gtk-text-mark-get-name.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>mark</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkTextMark.html" title="GtkTextMark"><span class="type">GtkTextMark</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-text-mark-get-name.returns"></a><h4>Returns</h4>
<p>mark name. </p>
<p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-text-mark-get-buffer"></a><h3>gtk_text_mark_get_buffer ()</h3>
<pre class="programlisting"><a class="link" href="GtkTextBuffer.html" title="GtkTextBuffer"><span class="returnvalue">GtkTextBuffer</span></a> *
gtk_text_mark_get_buffer (<em class="parameter"><code><a class="link" href="GtkTextMark.html" title="GtkTextMark"><span class="type">GtkTextMark</span></a> *mark</code></em>);</pre>
<p>Gets the buffer this mark is located inside,
or <code class="literal">NULL</code> if the mark is deleted.</p>
<div class="refsect3">
<a name="gtk-text-mark-get-buffer.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>mark</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkTextMark.html" title="GtkTextMark"><span class="type">GtkTextMark</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-text-mark-get-buffer.returns"></a><h4>Returns</h4>
<p>the mark’s <a class="link" href="GtkTextBuffer.html" title="GtkTextBuffer"><span class="type">GtkTextBuffer</span></a>. </p>
<p><span class="annotation">[<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-text-mark-get-left-gravity"></a><h3>gtk_text_mark_get_left_gravity ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gtk_text_mark_get_left_gravity (<em class="parameter"><code><a class="link" href="GtkTextMark.html" title="GtkTextMark"><span class="type">GtkTextMark</span></a> *mark</code></em>);</pre>
<p>Determines whether the mark has left gravity.</p>
<div class="refsect3">
<a name="gtk-text-mark-get-left-gravity.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>mark</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkTextMark.html" title="GtkTextMark"><span class="type">GtkTextMark</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-text-mark-get-left-gravity.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the mark has left gravity, <code class="literal">FALSE</code> otherwise</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="GtkTextMark.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GtkTextMark-struct"></a><h3>struct GtkTextMark</h3>
<pre class="programlisting">struct GtkTextMark;</pre>
</div>
</div>
<div class="refsect1">
<a name="GtkTextMark.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="GtkTextMark--left-gravity"></a><h3>The <code class="literal">“left-gravity”</code> property</h3>
<pre class="programlisting">  “left-gravity”             <span class="type">gboolean</span></pre>
<p>Whether the mark has left gravity. When text is inserted at the mark’s
current location, if the mark has left gravity it will be moved
to the left of the newly-inserted text, otherwise to the right.</p>
<p>Owner: GtkTextMark</p>
<p>Flags: Read / Write / Construct Only</p>
<p>Default value: FALSE</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkTextMark--name"></a><h3>The <code class="literal">“name”</code> property</h3>
<pre class="programlisting">  “name”                     <span class="type">char</span> *</pre>
<p>The name of the mark or <code class="literal">NULL</code> if the mark is anonymous.</p>
<p>Owner: GtkTextMark</p>
<p>Flags: Read / Write / Construct Only</p>
<p>Default value: NULL</p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>